package com.homework;

import com.homework.config.SpringConfig;
import com.homework.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    @Autowired
    private UserDao userDao;

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserDao userDao1 = context.getBean(UserDao.class);
        int count = userDao1.countAllUsers();
        System.out.println(count);
    }
}